<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>自动补全autocomplete</title>
		<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
		<script type="text/javascript" src="jqueryui/jquery-ui.min.js"></script>
		<link href="text/jquery-ui.min.css">
		<script type="text/javascript">
			$(function(){
				$("#keyword").autocomplete({
					//minLength:2,
					source:function(red,res){
						var courseName=req.term;
						$.get("course2","courseName="+courseName,function(data){
							var courses=data.split(",");
							res(courses);
						});
					},
				});
			});
		</script>
	</head>
	<body>
		课程：<input tupe="text" id="keyword" placeholder="请输入课程名称"/>
	</body>
</html>
